<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Preliminary Exercises</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Advanced Bash-Scripting Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Starting Off With a Sha-Bang"
HREF="sha-bang.html"><LINK
REL="PREVIOUS"
TITLE="Invoking the script"
HREF="invoking.html"><LINK
REL="NEXT"
TITLE="Basics"
HREF="part2.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Advanced Bash-Scripting Guide: </TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="invoking.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Starting Off With a Sha-Bang</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="part2.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="PRELIMEXER"
></A
>2.2. Preliminary Exercises</H1
><P
></P
><OL
TYPE="1"
><LI
><P
>System administrators often write scripts to automate common
	  tasks. Give several instances where such scripts would be
	  useful.</P
></LI
><LI
><P
>Write a script that upon invocation shows the
	  <A
HREF="timedate.html#DATEREF"
>time and date</A
>, <A
HREF="system.html#WHOREF"
>lists all logged-in users</A
>, and gives
	  the system <A
HREF="system.html#UPTIMEREF"
>uptime</A
>. The script
	  then <A
HREF="io-redirection.html#IOREDIRREF"
>saves this information</A
>
	  to a logfile.</P
></LI
></OL
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="invoking.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="part2.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Invoking the script</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="sha-bang.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Basics</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>